<?php

class Core_Translate extends Zend_Translate
{
	protected static $_instance = null;
	
	public function __construct(array $options = array())
	{
		return parent::__construct($options);
	}

	public static function load(array $options = array())
	{
		$_instance = get_called_class(); //PHP 5.3+
		self::$_instance = new $_instance($options);
		return self::$_instance;
	}
	
	public static function getInstance()
	{
		$_instance = get_called_class(); //PHP 5.3+
		if (null === self::$_instance) {
			throw new Zend_Exception('Run '.$_instance.'::load before');
		}
		return self::$_instance;
	}

	public static function _($messageId, $locale = null)
	{
		return Core_Translate::getInstance()->getAdapter()->_($messageId, $locale);
	}
}